<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Index Function
     */
    public function index()
    {
        //Set layout data
        $layout_data['pageTitle'] = 'Users - My site - Backend - Mr.Alex';
        $layout_data['navTab'] = 'user';
        $layout_data['content'] = $this->load->view('user/index', '', TRUE);

        //render to layout
        $this->load->view('layouts/main', $layout_data);
    }

    /**
     * Login function
     */
    public function login()
    {
        // If submit login
        if($this->input->post('submit'))
        {
            //Set seesion user login
            $_SESSION['uid'] = 1;
            //$this->session->set_userdata('uid', 1);

            //Redirect to index
            redirect('home');
        }
       
        //Set layout data
        $layout_data['pageTitle'] = 'Login - My site - Backend - Mr.Alex';

        //render to layout
        $this->load->view('layouts/login', $layout_data);
    }

    /**
     * Logout function
     */
    public function logout()
    {
        
    }

}

/* End of file Home.php */
/* Location: ./application/controllers/welcome.php */